<?php
$tblNews = new Zendvn_Models_NewsItem(); 
$hotNews = $tblNews->listItem($view->arrParam,array('task'=>'special'));
$tblCut  = new Zendvn_File_CutTring();
?>

<div class="header width-100">
    <div class="group-new01">
          <div class="group-new01-title">
            <p>Tin tức nổi bật</p>
          </div>
        <?php 
          $lang = $view->arrParam['lang'];
          if(empty($lang)){
          	$lang = 'vi';
          }else{
          	$lang = $view->arrParam['lang'];
          }
        
          foreach ($hotNews as $hn){
          		$hnName		= $hn['alias'];
          		$hnId		= $hn['id'];
                $hnTitle      = $hn['name'];
                $hnSummary_   = $hn['summary'];
                $hnSummary_    = $tblCut->cutTring('100', $hnSummary_, null);
                $hnSummary		= str_replace('\"', '', $hnSummary_);
                
                $realLink   = FILES_PATH. '/news/images450x450/' . $hn['picture'];
                if(!empty($hn['picture'])){
                    if(file_exists($realLink)){
                        $linkImg	= FILES_URL . '/news/images450x450/' . $hn['picture'];
                    }
                    else{
                        $linkImg	= $this->view->imgUrl.'/no-image.jpg';
                    }
                    $picture 	= '<img title="'. $hnTitle .'" src="'. $linkImg .'" width="110" height="70" alt="'.$hnTitle.'" />';
                }
                else{
                    $linkImg	= $this->view->imgUrl.'/news/images450x450/no-image.jpg';
                    $picture 	= '<img title="'. $hnTitle .'" src="'. $linkImg .'" width="110" height="70" alt="'.$hnTitle.'" />';
                }
                
                $urlOptions = array('module'=>'news',
	                               	'controller'=>'index',
	                                'action'=>'detail',
	                                'nname'=>$hnName,
	                                'id'=>$hnId,
	                                'lang'=>$lang);
                $linkProduct = $this->view->url($urlOptions,'news-detail');
            ?>
          <div class="group-new01-box">
                <div class="box width-48 float-left">
                    <div class="img"><?php echo $picture; ?></div>
                    <div class="text">
                        <h3><a title="<?php echo $hnTitle;?>" href="<?php echo $linkProduct;?>">
                        <?php echo $hnTitle; ?></a></h3>
                        <p><?php echo $hnSummary; ?></p>
                    </div>
                </div>

          </div>
        <?php } ?>
    <div class="clear"></div>
    </div>
</div>